package com.cskaoyan.javase.oop1._7exercise.pvz;

/**
 * 用面向对象的思想模拟植物大战僵尸
 * plant vs zombie
 * 对象: 豌豆射手对象,铁桶僵尸对象
 * 类: 僵尸类,植物类
 *
 * @since 11:20
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Test {
    public static void main(String[] args) {
        // 分别创建对象,然后模拟游戏的进程
        Plant p = new Plant("豌豆射手", 100, 1000, 500);
        Zombie z = new Zombie("铁桶僵尸", 5000, 300, 100);
        p.plantZ = z;
        z.zombieP = p;
        System.out.println("Game Start!僵尸开始入侵你的后花园!");
        p.planting();
        z.move();
        p.attack();
        z.beAttacked();
        System.out.println("经过了漫长的旅程,僵尸靠近了植物~");
        z.attack();
        p.beAttacked();
        System.out.println("植物老哥尽力了,但防线还是失守了!");
        z.eat();
        System.out.println("Game Over!");
    }
}
